package com.andkrup.web.application {
	import com.andkrup.web.components.IComponentFactory;
	import com.andkrup.web.data.DataProvider;

	import flash.display.DisplayObjectContainer;

	import com.andkrup.web.ui.UiManager;
	
	/**
	 * @author Andkrup
	 */
	public class ViewManager extends UiManager {
		private var base:DisplayObjectContainer;
		
		public function ViewManager(factory:IComponentFactory, base:DisplayObjectContainer) {
			this.base = base;
			super(factory);
		}
		
		public function displayView(id:String, dataProvider:DataProvider = null, factory:IComponentFactory = null):IView {
			if(factory){
				this.factory = factory;
			}
			var view:IView = getComponent(id) as IView;
			displayComponent(base, view, dataProvider);
			return view;
		}
	}
}
class ViewManagerConstructor{}